import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * @author Vincent Xie
 * @date 2010-6-4
 * @version $Id$
 */
public class UBIServer {
	public static void main(String[] args) throws Exception {
		long begin = System.currentTimeMillis();
		Connector connector = new SelectChannelConnector();
		connector.setPort(Integer.getInteger("jetty.port", 8080).intValue());
		WebAppContext webapp = new WebAppContext("web", "/pingan-stat");
		// webapp.setDefaultsDescriptor("./test/webdefault.xml");
		Server server = new Server();
		server.setConnectors(new Connector[] { connector });
		server.setHandler(webapp);
		server.start();
		System.out.println("Jetty ServerController started, use "
				+ (System.currentTimeMillis() - begin) + " ms");
	}
}
